/**
 *
 */
package com.googlecode.bip.dao;

import java.io.Serializable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

/**
 *
 * @author Claude CHOISNET
 */
@Deprecated
public class BipDAO implements Serializable
{
    private static final long serialVersionUID = 1L;
    private static transient DataSource dataSource;
    private static Object lock = new Object();

    /**
     * Returns DataSource
     * @return DataSource
     * @throws NamingException
     */
    @Deprecated
    final
    public DataSource getDataSource()
        throws NamingException
    {
        if( dataSource == null ) {
            synchronized( lock ) {
                final Context ctx = new InitialContext();

                dataSource  = (DataSource)ctx.lookup("java:comp/env/jdbc/bipol");
                }
            }

        return dataSource;
    }
}

/*
Expected child methods

public IXxx findXxx( ... )
{
}
public boolean insertXxx( final IXxx ixxx )
{
}
public boolean deleteXxx( final IXxx ixxx )
{
}
public boolean updateXxx( final IXxx ixxx )
{
}
*/
